<admintpl file="header" />
</head>
<body class="J_scroll_fixed">
		<div class="wrap jj">
		<ul class="nav nav-tabs">
			<li class="active"><a href="#">平台币发放</a></li>
		</ul>
		
		<div class="common-form">
			<form method="post" class="form-horizontal" action="{:U('Balance/give_post')}">
				<fieldset>
					<div class="control-group">
						<label class="control-label">账号类型:</label>
						<div class="controls">
							 <input type="radio" id="type_chooser" name="type" value="agent"  />一级代理							 
							 <input type="radio" id="type_chooser" name="type" value="sub"  />二级代理                                                        
						</div>
					</div>
					
					<div class="control-group">
						<label class="control-label">代理账号:</label>
						<div class="controls">
							<input type="text" class="input" name="username" id="username" value="">
							<!--<span id="usernamespan" style="color:#00F;display:none;">用户名不存在</span>-->
						</div>
					</div>
<!--					<div class="control-group">
						<label class="control-label">用户当前余额:</label>
						<div class="controls">
							<input type="text" class="input" name="oldptb" id="oldptb" style="color:blue;" value="0" readonly="readonly" >
						</div>
					</div>-->
					<div class="control-group">
						<label class="control-label">发放数量:</label>
						<div class="controls">
							<input type="text" class="input" name="amount" value="" autocomplete="off">
						</div>
					</div>
<!--					<div class="control-group">
						<label class="control-label">请填写充值金额:</label>
						<div class="controls">
							<input type="text" class="input" name="amount" value="" autocomplete="off">
						</div>
					</div>-->
					<div class="control-group">
						<label class="control-label">备注:</label>
						<div class="controls">
							<input type="text" class="input" name="beizhu" value="" autocomplete="off">
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">请填写二级密码:</label>
						<div class="controls">
							<input type="password" class="input" name="password" value="" autocomplete="off">
						</div>
					</div>
				</fieldset>
				<div class="form-actions">
					<!--<input name="adminsite" type="hidden"  id="adminsite" value="{:U('Ptb/ajaxGetPtb')}">-->
					<button type="submit" class="btn btn-primary btn_submit">确认</button>
				</div>
			</form>
		</div>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<!--<script src="__PUBLIC__/js/Ptb.js"></script>-->
        <script>
//        $("#submit").click(function(){
//            var prepass=$("input[name='prepass']").val();
//            var paypwd1=$("input[name='paypwd1']").val();
//            var paypwd2=$("input[name='paypwd2']").val();
//            $.post("{:U('SubAgent/Account/setPayPwd_post')}",{"prepass":prepass,"paypwd1":paypwd1,"paypwd2":paypwd2},function(data){
//                if(data.error==='0'){
//                    alert(data.msg);
//                }else if(data.error==='1'){
//                    alert(data.msg);
//                }
//            });
//        });
    
    $("#username").change(function(){
        var username=$("#username").val();
        $.post("{:U('Pay/Ptb/getAgentBalance')}",{"username":username},function(data){
            if(data.error==='0'){
                $("#oldptb").val(data.msg);
            }else if(data.error==='1'){
                alert(data.msg);
            }
        });
    });
        </script>
	
</body>
</html>